#include "hpy.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[])
{
    registerGen(argc, argv, 1);
    auto [n] = tuple{opt<int>(1)};
    println(n);
    vector<int> v(n);
    for(int i = 1; i < n; i ++) {
        int p = rnd.next(n);
        while(v[p] >= min(2, n - p - 1)) p = rnd.next(n);
        v[p] ++;
    }
    for(auto x : v)
        println(x, x);
}
